<%@page language="java" pageEncoding="UTF-8"%>
<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
<html>
	<head>
		<TITLE>通讯录列表</TITLE>
		<jsp:include page="../cssjsInList.jsp" flush="true"/>
	</head>
<body>
	<div id="content">
		<TABLE class=border cellSpacing=1 cellPadding=2 width="100%"
			align=center border=0>
			<TBODY>
				<TR class=topbg>
					<TD align=middle colSpan=2 height=22>
						<STRONG>通讯录管理</STRONG>
					</TD>
				</TR>
				<TR class=topbg>
					<TD>
						<STRONG> 
							<a href="<%=request.getContextPath()%>/libAddrManage.do?method=libaddrlist">通讯录管理首页</a>
							[ <a href="<%=request.getContextPath()%>/libAddrManage.do?method=libaddradd">添加通讯录</a>]
						</STRONG>
					</TD>
				</TR>
					<TR>
						<TD>
							<br>
							<form name=form action="<%=request.getContextPath()%>/libAddrManage.do?method=libaddrlist" method=get>
								<TABLE width="100%" align=center border=0>
									<TR>
										<TD>
											<INPUT onclick=submit(); type=radio CHECKED id="all"  value=''
												name=area <c:if test="${area==''}" > checked</c:if>>
											所有人&nbsp;&nbsp;&nbsp;
											<INPUT onclick=submit(); type=radio id="east"  value="east"
												name=area <c:if test="${area=='east'}" > checked</c:if>>
											东校区&nbsp;&nbsp;&nbsp;
											<INPUT onclick=submit(); type=radio id="west"  value="west"
												name=area <c:if test="${area=='west'}" > checked</c:if>>
											西校区&nbsp;&nbsp;&nbsp;&nbsp;
										</TD>
									</TR>
								</TABLE>
							</form>
						</TD>
					</TR>
			</TBODY>
		</TABLE>
		<!-- 一级table 提供“搜索功能” -->
		<table border="0" width="100%" align="center">							
			<tr>
				<td align="center">
					<form action="<%=request.getContextPath()%>/libAddrManage.do?method=libaddrlist" method="post">
						<SELECT size=1 name=keywordType>
							<OPTION value=name selected>
								姓名
							</OPTION>
							<OPTION value=department>
								部门
							</OPTION>
							<OPTION value=position>
								职位
							</OPTION>
							<OPTION value=tel>
								电话
							</OPTION>
						</SELECT>
						<input name="keyword" type="text" size="40" maxlength="40" value="${keywordOld}" />
						<input name="button" type="submit" value="查找" />
					</form>
				</td>
			</tr>	
		</table>
		<!-- 一级table 显示列表 -->
		<table width="100%" border="0" cellspacing="0" cellpadding="0" class="data">
				<tr>
					<th width="2%" align="center" nowrap="nowrap">
						ID
					</th>
					<th width="10%" align="center" nowrap="nowrap">
						姓名
					</th>
					<th width="10%" align="center" nowrap="nowrap">
						部门
					</th>
					<th width="6%" align="center" nowrap="nowrap">
						职位
					</th>
					<th width="10%" align="center" nowrap="nowrap">
						电话
					</th>
					<th width="15%" align="center" nowrap="nowrap">
						E-Mail
					</th>
					<th width="6%" align="center" nowrap="nowrap">
						校区 
					</th>
					<th width="6%" align="center" nowrap="nowrap">
						管理操作
					</th>
				</tr>
				<c:forEach items="${libaddrlist}" var="libaddr">
					<c:if test="${libaddr.libaddrID%2==1}">
						<c:set var="rowtype" value="odd" />
					</c:if>
					<c:if test="${libaddr.libaddrID%2==0}">
						<c:set var="rowtype" value="even" />
					</c:if>
					<tr class="${rowtype}" onMouseOver="this.className = 'row_over';"
						onMouseOut="this.className = '${rowtype}';">
						<td width="6%" align="center" nowrap="nowrap">
							${libaddr.libaddrID}
						</td>
						<td width="6%" align="center" nowrap="nowrap">
							<a	href="<%=request.getContextPath()%>/libAddrManage.do?method=libaddrContent&libaddrID=${libaddr.libaddrID}">${libaddr.name}</a>
						</td>
						<td align="right" nowrap="nowrap">
							<div align="center">
								<a href="<%=request.getContextPath()%>/libAddrManage.do?method=libaddrlist&department=${libaddr.department}">
								${libaddr.departmentString}
								</a>
							</div>
						</td>
						</td>
						<td width="6%" align="center" nowrap="nowrap">
							${libaddr.position}
						</td>
						<td width="6%" align="center" nowrap="nowrap">
							${libaddr.tel}
						</td>
						<td width="6%" align="center" nowrap="nowrap">
							${libaddr.email}
						</td>
						</td>
						<td width="6%" align="center" nowrap="nowrap">
							${libaddr.area}
						</td>

						<td align="center" nowrap="nowrap">
							<a href="<%=request.getContextPath()%>/libAddrManage.do?method=libaddredit&libaddrID=${libaddr.libaddrID}">编辑</a>
							|<a href="<%=request.getContextPath()%>/libAddrManage.do?method=libaddrdel&libaddrID=${libaddr.libaddrID}" 
								onClick="return confirm('您确定要删除 ${libaddr.name} ？');">删除</a>
						</td>
					</tr>
				</c:forEach>
			<tr>
				<td colspan="15" align="center" bgcolor="#FCFCFC">
					<jsp:include page="../page.jsp" flush="true"/>			
				</td>
			</tr>
		</table>
	</div>
</body>
</HTML>